TRA

Syntax: TRA table1 [,table2]     
    or: TRA [table1] ,table2
Location: QL ROM (post JM Version)

This command allows you to perform various translations on data that is passing through the serial ports.

The use of TRA will (on non-SMS implementations) affect all data which is sent through the serial ports after the command has been issued, translating bytes whether they are screen dumps, printer control codes, or letters of the alphabet.

The two parameters are addresses of two tables, table1 which contains details of translations to be carried out on both incoming and outgoing data and table2 which contains details of various messages used by the system. Both tables are recognised by the word 19195 ($4AFB) at their start.

If either parameter is not specified, then the default value of -1 is assumed, which tells QDOS to leave that translation table alone.

When QDOS is first initiated translation is not enabled, which means that data passing through the serial ports is unaffected. You can revert to this situationby using the command TRA 0.  You can also revert to the original error messages with TRA ,1.  Use TRA 0,1 to reset both.

The English character set is used in all ROM implementations of the QL (no matter which country the machine is set up for). However, you can select to use the 'local' character set for serial communication purposes if you wish by using the command TRA 1 which tells QDOS to use the 'local' translation table.

The two translation tables have different formats and uses, depending on whether the serial ports are being used for transmission or receipt of data.

However, the format of the tables is extremely complex and beyond the scope of this help file.  Refer to the SBASIC / SuperBASIC Reference Manual for full details.

SMS Notes:
SMS also allows you to have language dependent translation tables (linked to one of the languages currently loaded - see LANG_USE).  To enable these, use the command:

TRA 1,lang

where lang is the Car Registration Code or Language code of the country.

TRA 0,lang 

will set up the relevent translation table, ready to be enabled with TRA 1.

There are also several in-built language independent translate tables which are accessed by setting table1 to small values.

Currently there are only two language independent translate tables supported:

TRA 3 Enable IBM Graphics translation table.

TRA 5 Enable GEM VDI translation table.

Also please note that under SMS, TRA will only affect channels which are OPENed after the TRA command, or channels which have already been OPENed with TRA active. In any case, TRA 0 never affects OPEN channels. TRA address will also not affect OPEN channels which have been affected by TRA 0.  Note however that changing the BAUD rate will affect the translate on ALL channels.
